All Packages Class Hierarchy This Package Previous Next Index
Interface com.sun.java.swing.tree.TreeSelectionModel
- public interface TreeSelectionModel
This interface represents the current state of the selection for
the tree component. It will keep track of the selected rows, but
in order to select by row you will need to go directly to the tree.
-
CONTIGUOUS_TREE_SELECTION
- Selection can only be contiguous.
-
DISCONTIGUOUS_TREE_SELECTION
- Selection can contain any number of items that are not necessarily
contiguous.
-
SINGLE_TREE_SELECTION
- Selection can only contain one path at a time.
-
addPropertyChangeListener(PropertyChangeListener)
- Add a PropertyChangeListener to the listener list.
-
addSelectionPath(TreePath)
- Adds path to the current selection.
-
addSelectionPaths(TreePath[])
- Adds paths to the current selection.
-
addTreeSelectionListener(TreeSelectionListener)
- Adds x to the list of listeners that are notified each time the
selection changes.
-
clearSelection()
- Empties the current selection.
-
getLeadSelectionPath()
- Returns the last path that was added.
-
getLeadSelectionRow()
- Returns the lead selection index.
-
getMaxSelectionRow()
- Gets the last selected row.
-
getMinSelectionRow()
- Gets the first selected row.
-
getRowMapper()
- Returns the RowMapper instance that is able to map a path to a
row.
-
getSelectionCount()
- Returns the number of paths that are selected.
-
getSelectionMode()
- Returns the selection mode.
-
getSelectionPath()
- Returns the first path in the selection.
-
getSelectionPaths()
- Returns the paths in the selection.
-
getSelectionRows()
- Returns all of the currently selected rows.
-
isPathSelected(TreePath)
- Returns true if the path, path, is in the current selection.
-
isRowSelected(int)
- Returns true if the row identitifed by row is selected.
-
isSelectionEmpty()
- Returns true if the selection is currently empty.
-
removePropertyChangeListener(PropertyChangeListener)
- Remove a PropertyChangeListener from the listener list.
-
removeSelectionPath(TreePath)
- Removes path from the selection.
-
removeSelectionPaths(TreePath[])
- Removes paths from the selection.
-
removeTreeSelectionListener(TreeSelectionListener)
- Removes x from the list of listeners that are notified each time
the selection changes.
-
resetRowSelection()
- Updates what rows are selected.
-
setRowMapper(RowMapper)
- Sets the RowMapper instance.
-
setSelectionMode(int)
- Sets the selection model, which must be one of SINGLE_TREE_SELECTION,
CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION.
-
setSelectionPath(TreePath)
- Sets the selection to path.
-
setSelectionPaths(TreePath[])
- Sets the selection to the the paths.
SINGLE_TREE_SELECTION
public static final int SINGLE_TREE_SELECTION
- Selection can only contain one path at a time.
CONTIGUOUS_TREE_SELECTION
public static final int CONTIGUOUS_TREE_SELECTION
- Selection can only be contiguous. This will only be enforced if
a RowMapper instance is provided.
DISCONTIGUOUS_TREE_SELECTION
public static final int DISCONTIGUOUS_TREE_SELECTION
- Selection can contain any number of items that are not necessarily
contiguous.
setSelectionMode
public abstract void setSelectionMode(int mode)
- Sets the selection model, which must be one of SINGLE_TREE_SELECTION,
CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION.
getSelectionMode
public abstract int getSelectionMode()
- Returns the selection mode.
setSelectionPath
public abstract void setSelectionPath(TreePath path)
- Sets the selection to path. If this represents a change, then
the TreeSelectionListeners are notified.
- Parameters:
- path - new path to select
setSelectionPaths
public abstract void setSelectionPaths(TreePath paths[])
- Sets the selection to the the paths. If this represents a
change the TreeSelectionListeners are notified.
- Parameters:
- paths - new selection.
addSelectionPath
public abstract void addSelectionPath(TreePath path)
- Adds path to the current selection. If path is not currently
in the selection the TreeSelectionListeners are notified.
- Parameters:
- path - the new path to add to the current selection.
addSelectionPaths
public abstract void addSelectionPaths(TreePath paths[])
- Adds paths to the current selection. If any of the paths in
paths are not currently in the selection the TreeSelectionListeners
are notified.
- Parameters:
- path - the new path to add to the current selection.
removeSelectionPath
public abstract void removeSelectionPath(TreePath path)
- Removes path from the selection. If path is in the selection
The TreeSelectionListeners are notified.
- Parameters:
- path - the path to remove from the selection.
removeSelectionPaths
public abstract void removeSelectionPaths(TreePath paths[])
- Removes paths from the selection. If any of the paths in paths
are in the selection the TreeSelectionListeners are notified.
- Parameters:
- path - the path to remove from the selection.
getSelectionPath
public abstract TreePath getSelectionPath()
- Returns the first path in the selection.
getSelectionPaths
public abstract TreePath[] getSelectionPaths()
- Returns the paths in the selection.
getSelectionCount
public abstract int getSelectionCount()
- Returns the number of paths that are selected.
isPathSelected
public abstract boolean isPathSelected(TreePath path)
- Returns true if the path, path, is in the current selection.
isSelectionEmpty
public abstract boolean isSelectionEmpty()
- Returns true if the selection is currently empty.
clearSelection
public abstract void clearSelection()
- Empties the current selection. If this represents a change in the
current selection, the selection listeners are notified.
setRowMapper
public abstract void setRowMapper(RowMapper newMapper)
- Sets the RowMapper instance. This instance is used to determine
what row corresponds to what path.
getRowMapper
public abstract RowMapper getRowMapper()
- Returns the RowMapper instance that is able to map a path to a
row.
getSelectionRows
public abstract int[] getSelectionRows()
- Returns all of the currently selected rows.
getMinSelectionRow
public abstract int getMinSelectionRow()
- Gets the first selected row.
getMaxSelectionRow
public abstract int getMaxSelectionRow()
- Gets the last selected row.
isRowSelected
public abstract boolean isRowSelected(int row)
- Returns true if the row identitifed by row is selected.
resetRowSelection
public abstract void resetRowSelection()
- Updates what rows are selected. This can be externally called in
case the location of the paths change, but not the actual paths.
You do not normally need to call this.
getLeadSelectionRow
public abstract int getLeadSelectionRow()
- Returns the lead selection index. That is the last index that was
added.
getLeadSelectionPath
public abstract TreePath getLeadSelectionPath()
- Returns the last path that was added.
addPropertyChangeListener
public abstract void addPropertyChangeListener(PropertyChangeListener listener)
- Add a PropertyChangeListener to the listener list.
The listener is registered for all properties.
A PropertyChangeEvent will get fired in response to an
explicit setFont, setBackground, or SetForeground on the
current component. Note that if the current component is
inheriting its foreground, background, or font from its
container, then no event will be fired in response to a
change in the inherited property.
- Parameters:
- listener - The PropertyChangeListener to be added
removePropertyChangeListener
public abstract void removePropertyChangeListener(PropertyChangeListener listener)
- Remove a PropertyChangeListener from the listener list.
This removes a PropertyChangeListener that was registered
for all properties.
- Parameters:
- listener - The PropertyChangeListener to be removed
addTreeSelectionListener
public abstract void addTreeSelectionListener(TreeSelectionListener x)
- Adds x to the list of listeners that are notified each time the
selection changes.
- Parameters:
- x - the new listener to be added.
removeTreeSelectionListener
public abstract void removeTreeSelectionListener(TreeSelectionListener x)
- Removes x from the list of listeners that are notified each time
the selection changes.
- Parameters:
- x - the listener to remove.
All Packages Class Hierarchy This Package Previous Next Index